/**
 * Created by WLG on 2018/11/22.
 */
let log4js = require("log4js");
let logConfig = require("./config/logConf");
log4js.configure(logConfig);

let logger = log4js.getLogger();
logger.info("hello world categories-default test, this is info");
logger.debug("hello world categories-default test, this is debug");
logger.warn("hello world categories-default test, this is warn");
logger.error("hello world categories-default test, this is error");

logger = log4js.getLogger('production');
logger.info("hello world categories-production test, this is info");
logger.debug("hello world categories-production test, this is debug");
logger.warn("hello world categories-production test, this is warn");
logger.error("hello world categories-production test, this is error");

logger = log4js.getLogger('console'); //引用的categories 类型中的console  即输出到console控制台 输出日志级别info(大于info输出)
logger.info("hello world categories-console test");

logger = log4js.getLogger('debug');
logger.info("hello world categories-debug test, this is info");
logger.debug("hello world categories-debug test, this is debug");